Programming Android by Zigurd Mednieks Laird Dornin G. Blake Meike & Masumi Nakamura

Programming Android by Zigurd Mednieks Laird Dornin G. Blake Meike & Masumi Nakamura

Author:Zigurd Mednieks, Laird Dornin, G. Blake Meike & Masumi Nakamura [Zigurd Mednieks, Laird Dornin, G. Blake Meike, and Masumi Nakamura]
Language: eng
Format: epub
Tags: COMPUTERS / Programming Languages / General
ISBN: 9781449318543
Publisher: O'Reilly Media
Published: 2012-09-27T16:00:00+00:00


Function that fashions a query based on the user’s requested sort column (the sortBy parameter) and returns results as a cursor.

Creates the query string. Most of the string is static (the QUERY variable), but this line tacks on the sort column. Even though QUERY is private, it is still available to the enclosing class. This is because the getJobs method and the JobsCursor class are both within the MicroJobsDatabase class, which makes JobsCursor’s private data members available to the getJobs method.

To get the text for the sort column, we just run toString on the enumerated parameter passed by the caller. We could have defined an associative array, which would give us more flexibility in naming variables, but this solution is simpler. Additionally, the names of the columns pop up quite nicely using your IDE’s autocompletion.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.